import logging

class Logwriter():

    def __init__(self, savepath="./logs.txt"):
    
        logging.basicConfig(filename = savepath, 
                            filemode = "w",
                            level=logging.INFO,
                            format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
        logging.getLogger(__name__)
        
    def debug(self, message):
        logging.debug("{}".format(message))
    
    def info(self, message):
        logging.info("{}".format(message))
    
    def warning(self, message):
        logging.warning("{}".format(message))
    
    def error(self, message):
        logging.error("{}".format(message))
    
if __name__ == "__main__":
    
    logger = Logwriter()
    logger.info("This is an INFO Message.")
